/**
 *
 * For Dialog Box KO
 * http://jsfiddle.net/YmQTW/1/
 *
 * 	================================================================================== Tab 3 =======================
 */

function assesmentVO(assessmentId, assessmentTitle, assessmentType, startDate, endDate, weightage, reportLock) {
	//console.log("assessmentType:" , assessmentType);
	this.assessmentId = ko.observable(assessmentId)
	this.assessmentTitle = ko.observable(assessmentTitle)
	this.assessmentType = ko.observable(assessmentType)
	this.startDate = ko.observable(startDate)
	this.endDate = ko.observable(endDate)
	this.weightage = ko.observable(weightage)
	this.reportLock = ko.observable(reportLock)
};

function newTermVO(sectionId, termTitle, startDate, endDate, assessments) {
	// console.log("sectionId :" , sectionId);
	// console.log("termTitle :" , termTitle);
	// console.log("startDate :" , startDate);
	// console.log("endDate :" , endDate);

	this.sectionId = ko.observable(sectionId);
	this.termTitle = ko.observable(termTitle);
	this.startDate = ko.observable(startDate);
	this.endDate = ko.observable(endDate);
	var mappedData = jQuery.map(assessments, function(item) {
		return new assesmentVO(item.assessmentId, item.assessmentTitle, item.assessmentType, item.startDate, item.endDate, item.weightage, item.reportLock)
	});
	this.assessments = ko.observable(mappedData);

	//console.log("assessments :: ", this.assessments());
}

function myNewTermVO() {

	this.sectionId = ko.observable("sec id new 1");
	this.termTitle = ko.observable("term new 1");
	this.startDate = ko.observable("date new 1");
	this.endDate = ko.observable("end date new 1");

	this.assessments = ko.observable(new assesmentVO("new assess 1", "title new", 1, "s date", "e date", 20, 1));

	//console.log("assessments :: ", this.assessments());
}